import {
	aixos,
	payFn,
	silentLogin,
	createParmas,
	authorizationLogin,
	getPhoneNumber,
} from '@/api/request.js'
let api = {
	//首页商品列表
	getGoodList(params) {
		return aixos("goods/list", "GET", params || '')
	},
	//订单列表
	getOrderList(params) {
		return aixos("order/list", "GET", params || '', true)
	},
	//静默登录
	silentLogin(provider) {
		return silentLogin("third/user/login", "POST", provider || '')
	},
	//授权登录
	authorizationLogin(provider) {
		return authorizationLogin(provider, "third/user/update", "POST", 'wx')
	},
	//获取手机号
	getPhoneNumber(e) {
		return getPhoneNumber(e, "third/user/updateTel", "POST", 'wx')
	},
	//生成订单并拉起支付
	createParmas(orderId) {
		return createParmas("order/add", "POST", orderId, "wxpay")
	},
	//生成订单
	createOrder(params) {
		return aixos("order/add", "POST", params || '', true)
	},
	//拉起支付
	pay(params, provider) {
		return payFn(provider || '', params)
	}
}
export default api
